package com.xiake.consultsystem.controller;


import com.xiake.consultsystem.pojo.dto.CancelParam;
import com.xiake.consultsystem.pojo.vo.Result;
import com.xiake.consultsystem.service.AdminService;
import com.xiake.consultsystem.pojo.vo.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.Date;

/**
 *
 */
@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    AdminService adminService;
    /**
     * 管理员登录接口
     * @return
     */
    @PostMapping("/adminLogin")
    public Result adminLogin(@RequestParam String account, @RequestParam String password) {
        return adminService.adminLogin(account,password);
    }

    @ApiOperation("管理员查看预约信息的接口")
    @PostMapping("show")
    public Result showAvailableCounselor3(
            @RequestParam @DateTimeFormat(pattern = "yy-MM-dd") Date date,
            String studentName,
            Long counselorId){
        return adminService.showAvailableCounselor3(date, counselorId, studentName);
    }
    @ApiOperation("管理员修改是否通知的接口")
    @PostMapping("beinform")
    public Result beinform(@RequestBody CancelParam cancelParam){
        return adminService.beinform(cancelParam);
    }
    @ApiOperation("管理员取消预约的接口")
    @PostMapping("cancel")
    public Result camcel(@RequestBody CancelParam cancelParam){
        return adminService.cancel(cancelParam);
    }
}

